namespace SpellCenter.Core
{
    sealed public class WordContext
    {
        private readonly string _word;
        private string _context;
        private int _offset;
        private readonly string _reference = string.Empty;

        internal WordContext(string word, string context, int offset)
        {
            _word = word;
            _context = context;
            _offset = offset;
        }

        internal WordContext(string word,  string context, int offset, string reference)
            :this(word, context, offset)
        {
          _reference = reference;
        }

        public string Word
        {
            get { return _word; }
        }

        public string Context
        {
            get { return _context; }
            set { _context = value; }
        }

        /// <summary>
        /// The offset within <code>Context</code> that <code>Word</code> appears
        /// </summary>
        public int Offset
        {
            get { return _offset; }
            set { _offset = value; }
        }

        public string Reference
        {
            get { return _reference; }
        }
    }
}